/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package eypweb_bsc;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.effect.*;
import javafx.scene.text.Text;

/**
 *
 * @author Kohalmi Istvan
 */

// fomenut megvalosito osztaly
public class MainMenu implements Initializable {
    // cimke uzenetekhez
    @FXML
    private Label errorLabel;
    // teglalapok a fo menupontokhoz
    @FXML
    private Rectangle redRectangle;
    @FXML
    private Rectangle orangeRectangle;
    @FXML
    private Rectangle blueRectangle;
    @FXML
    private Rectangle greenRectangle;
    // szovegek a fo menupontokhoz
    @FXML
    private Text redText;
    @FXML
    private Text orangeText;
    @FXML
    private Text blueText;
    @FXML
    private Text greenText;
    // teglalapok az almenu pontokhoz
    @FXML
    private Rectangle eszk_cs;
    @FXML
    private Rectangle bef_cs;
    @FXML
    private Rectangle deviza;
    @FXML
    private Rectangle isin;
    @FXML
    private Rectangle port;
    @FXML
    private Rectangle vagyon;
    @FXML
    private Rectangle tran;
    @FXML
    private Rectangle leltar;
    @FXML
    private Rectangle muveletek;
    // almenu pontokat tartalmazo feszitesek
    @FXML
    private GridPane masterData;
    @FXML
    private GridPane transactions;
    
    // a MainMenu.fxml fajlban deklaralt esemenykezelok
    
    // eger adott terulet fole er
    @FXML
    private void handleEnterMasterData(MouseEvent event) {
        // hatterszin allitasa
        redRectangle.setFill(Color.YELLOW);
        // effekt beallitasa
        redRectangle.setEffect(new BoxBlur());
        redText.setEffect(new BoxBlur());
        // almenu pontok latszodnak
        masterData.setVisible(true);
        errorLabel.setText("Ez a menüpont a törzsadatok frissítésekor választandó.");
    }

    // eger elmozdul a teruletrol
    @FXML
    private void handleExitMasterData(MouseEvent event) {
        // hatterszin beallitasa
        redRectangle.setFill(Color.GRAY);
        // effekt torlese
        redRectangle.setEffect(null);
        redText.setEffect(null);
        // almenu elrejtese
        masterData.setVisible(false);
        errorLabel.setText("");
    }

    // kattintas
    @FXML
    private void handleClickMasterData(MouseEvent event) {
    }

    @FXML
    private void handleEnterTransactionalData(MouseEvent event) {
        blueRectangle.setFill(Color.YELLOW);
        blueRectangle.setEffect(new BoxBlur());
        blueText.setEffect(new BoxBlur());
        transactions.setVisible(true);
        errorLabel.setText("Ez a menüpont tranzakciók felvitele esetén választandó. Az adatrögzítés történhet kézzel, illetve fájl importálással.");
    }

    @FXML
    private void handleExitTransactionalData(MouseEvent event) {
        blueRectangle.setFill(Color.GRAY);
        blueRectangle.setEffect(null);
        blueText.setEffect(null);
        transactions.setVisible(false);
        errorLabel.setText("");
    }

    @FXML
    private void handleClickTransactionalData(MouseEvent event) {
    }

    @FXML
    private void handleEnterQuery(MouseEvent event) {
        greenRectangle.setFill(Color.YELLOW);
        greenRectangle.setEffect(new BoxBlur());
        greenText.setEffect(new BoxBlur());
        errorLabel.setText("Az értékpapírok piaci elemzéséhez választandó ez a menüpont.");
    }

    @FXML
    private void handleExitQuery(MouseEvent event) {
        greenRectangle.setFill(Color.GRAY);
        greenRectangle.setEffect(null);
        greenText.setEffect(null);
        errorLabel.setText("");
    }

    // adatelemzo kepernyo inditasa
    @FXML
    private void handleClickQuery(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeQueryScene();
    }

    @FXML
    private void handleEnterEvaluation(MouseEvent event) {
        orangeRectangle.setFill(Color.YELLOW);
        orangeRectangle.setEffect(new BoxBlur());
        orangeText.setEffect(new BoxBlur());
        errorLabel.setText("A rögzített adatok alapján történő beértékeléshez választandó ez a menüpont.");
    }

    @FXML
    private void handleExitEvaluation(MouseEvent event) {
        orangeRectangle.setFill(Color.GRAY);
        orangeRectangle.setEffect(null);
        orangeText.setEffect(null);
        errorLabel.setText("");
    }

    // piaci ertekeles ablak inditasa
    @FXML
    private void handleClickEvaluation(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeEvaluationScreen();
    }

    // eszkozcsoport kezelo kepernyo inditasa
    @FXML
    private void handleClickedInstrument(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeInstrumentScreen();
    }

    @FXML
    private void handleEnterInstrument(MouseEvent event) {
        eszk_cs.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitInstrument(MouseEvent event) {
        eszk_cs.setFill(Color.WHITE);
    }
    
    // deviza kezelo kepernyo inditasa
    @FXML
    private void handleClickedCurrency(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeCurrencyScreen();
    }

    @FXML
    private void handleEnterCurrency(MouseEvent event) {
        deviza.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitCurrency(MouseEvent event) {
        deviza.setFill(Color.WHITE);
    }
    
    // befektetesi csoport kezelo kepernyo inditasa
    @FXML
    private void handleClickedInvestment(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeInvestmentGroupScreen();
    }

    @FXML
    private void handleEnterInvestment(MouseEvent event) {
        bef_cs.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitInvestment(MouseEvent event) {
        bef_cs.setFill(Color.WHITE);
    }
    
    // ertekpapir kezelo kepernyo inditasa
    @FXML
    private void handleClickedISIN(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeSecuritiesScreen();
    }

    @FXML
    private void handleEnterISIN(MouseEvent event) {
        isin.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitISIN(MouseEvent event) {
        isin.setFill(Color.WHITE);
    }
    
    // portfolio kezelo kepernyo inditasa
    @FXML
    private void handleClickedPortfolio(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializePortfolioScreen();
    }

    @FXML
    private void handleEnterPortfolio(MouseEvent event) {
        port.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitPortfolio(MouseEvent event) {
        port.setFill(Color.WHITE);
    }
    
    // vagyonkezelo rogzito kepernyo inditasa
    @FXML
    private void handleClickedTrustee(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeTrusteeScreen();
    }

    @FXML
    private void handleEnterTrustee(MouseEvent event) {
        vagyon.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitTrustee(MouseEvent event) {
        vagyon.setFill(Color.WHITE);
    }
    
    // tranzakciotipus kezelo kepernyo inditasa
    @FXML
    private void handleClickedTransaction(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeTransactionScreen();
    }

    @FXML
    private void handleEnterTransaction(MouseEvent event) {
        tran.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitTransaction(MouseEvent event) {
        tran.setFill(Color.WHITE);
    }
    
    // nyito leltar betoltese
    @FXML
    private void handleClickedInventory(MouseEvent event) {
        XLSHandler.importInventory();
    }

    @FXML
    private void handleEnterInventory(MouseEvent event) {
        leltar.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitInventory(MouseEvent event) {
        leltar.setFill(Color.WHITE);
    }
    
    // muvelet rogzito kepernyo betoltese
    @FXML
    private void handleClickedOperation(MouseEvent event) {
        Director director = Director.getInstance();
        director.initializeTrusteeSelectionScreen();
    }

    @FXML
    private void handleEnterOperation(MouseEvent event) {
        muveletek.setFill(Color.GOLD);
    }

    @FXML
    private void handleExitOperation(MouseEvent event) {
        muveletek.setFill(Color.WHITE);
    }

    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    }
}
